package com.commpany.servie.basic.tag.service.write;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import com.commpany.jiedianqian.system.exception.BusinessException;
import com.commpany.jiedianqian.system.exception.SystemErrorEnum;
import com.commpany.servie.basic.tag.api.write.ProductTagMapWriteService;
import com.commpany.servie.basic.tag.converter.ProductTagMapConverter;
import com.commpany.servie.basic.tag.business.write.productTagMap.ProductTagMapWriteManage;
import com.commpany.servie.basic.tag.model.dto.producttagmap.ProductTagMapDTO;
@Slf4j
@Service("productTagMapWriteService")
public class ProductTagMapWriteServiceImpl  implements ProductTagMapWriteService {
	@Autowired
	private ProductTagMapWriteManage productTagMapWriteManage;
	
	public int insertProductTagMapService( ProductTagMapDTO inputDTO ){
	   try {
	       return productTagMapWriteManage.insertProductTagMapService(ProductTagMapConverter.toPO(inputDTO));
	     } catch (Exception e) {
			// TODO Auto-generated catch block
			log.error("系统异常", e);
			throw new BusinessException(SystemErrorEnum.SYSTEM_ERROR.getValue(), SystemErrorEnum.SYSTEM_ERROR.name());
		}
	}
    public int updateProductTagMapService( ProductTagMapDTO inputDTO ){
       try {
           return productTagMapWriteManage.updateProductTagMapService(ProductTagMapConverter.toPO(inputDTO));
        } catch (Exception e) {
			// TODO Auto-generated catch block
			log.error("系统异常", e);
			throw new BusinessException(SystemErrorEnum.SYSTEM_ERROR.getValue(), SystemErrorEnum.SYSTEM_ERROR.name());
		}
    }
    public int deleteProductTagMapService( ProductTagMapDTO inputDTO ){
      try {
          return productTagMapWriteManage.deleteProductTagMapService(ProductTagMapConverter.toPO(inputDTO));
      } catch (Exception e) {
			// TODO Auto-generated catch block
			log.error("系统异常", e);
			throw new BusinessException(SystemErrorEnum.SYSTEM_ERROR.getValue(), SystemErrorEnum.SYSTEM_ERROR.name());
		}
    }
}
	